<?php

namespace App\Http\Services;

use App\Http\Model\Device;
use App\Http\Model\MonitoringLink\HuaweiCallbackLogs;

/**
 * 监测链接
 *
 * Created on 2021/11/2 17:12
 * @Author <yuxiang.zhu@asiainnovations.net>
 */
class MonitoringLinkServices extends CommonServices
{
    /**
     * Created at 2021/11/2 17:22
     * @Author <yuxiang.zhu@asiainnovations.net>
     * @param array $params
     */
    public function huawei(array $params)
    {
        $ua = $this->parse_app_UA();
        $params['guid'] = $ua['guid'];
        HuaweiCallbackLogs::query()->create($params);
        $channel = $params['channel'] ?? '';//渠道号
        if ($params['guid'] && $channel) {
            (new Device())->singleUpdate(['guid' => $params['guid']], ['platform' => $channel]);
        }
    }
}